<?php
/**************************
@Author  : sulwan
@Content : 测试文件
**************************/
include_once(dirname(__file__).'/../init.php');
showIndex();
/*默认执行函数*/
function showIndex() {
	global $config;
	if(_g('username')){
		$username = trim(_g('username'));
		$userPassword = trim(_g('userPassword'));
		$userInfo = User::checkLogin($username,$userPassword,$fillInfo = false,'username');
		$uid = $userInfo['uid'];
		if($uid){
			$login = User::login($userInfo);
			$url = 'http://'.$config['web'];
			$time = 2;
			$msg = '登录成功';
			redirect($url,$time,$msg);
			exit;
		}else{
			$url = 'http://'.$config['web'];
			$time = 2;
			$msg = '登录失败，请检查用户名或者密码是否正确';
			redirect($url,$time,$msg);
			exit;
		}
	}else{
		$userInfo = userInfo();
		$uid = $userInfo['uid'];
		include template('apps/login');
	}
}










?>